import request from '@/utils/request'

export function fetchList(data) {
  return request({
    url: 'book/selectPageByBookName',
    method: 'post',
    data
  })
}
export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createBook(data) {
  return request({
    url: 'book/addBook',
    method: 'post',
    data
  })
}

export function updateBook(data) {
  return request({
    url: 'book/editBook',
    method: 'put',
    data
  })
}
export function deleteBook(data) {
  return request({
    url: 'book/delete/' + data,
    method: 'delete'
  })
}
